#include "HistoryTrackLinePrivate.h"
#include "HistoryTrackPointPrivate.h"

HistoryTrackLinePrivate::HistoryTrackLinePrivate()
{
}

HistoryTrackLinePrivate::~HistoryTrackLinePrivate()
{
}

HistoryTrackPoint* HistoryTrackLinePrivate::createTrackPoint(double lon,double lat,double alt)
{
	return new HistoryTrackPointPrivate(this);
}

void HistoryTrackLinePrivate::appendTrackPoint(HistoryTrackPoint* point)
{
	if(point && point->getTrackLine() == this)
		trackPoints.append(point);
}

void HistoryTrackLinePrivate::insertTrackPoint(HistoryTrackPoint* point,quint32 index)
{
	if(point && point->getTrackLine() == this)
		trackPoints.insert(index,point);
}

void HistoryTrackLinePrivate::removeTrackPointByIndex(quint32 index)
{
	trackPoints.removeAt(index);
}

void HistoryTrackLinePrivate::removeAllPoints()
{
	foreach(auto point,trackPoints)
		delete point;
	trackPoints.clear();
}

bool HistoryTrackLinePrivate::isEmpty()
{
	return trackPoints.isEmpty();
}

bool HistoryTrackLinePrivate::getPointVisible() const
{
	return pointVisible;
}

void HistoryTrackLinePrivate::setPointVisible(bool visible)
{
	pointVisible = visible;
}

int  HistoryTrackLinePrivate::getPointSize() const
{
	return pointSize;
}

void HistoryTrackLinePrivate::setPointSize(int newPointSize)
{
	pointSize = newPointSize;
}